Skip to content

Conversation

@jorgenfj
Copy link
Contributor

Util function to convert from ros2 pose message types to Eigen::Matrix<double, 6, Eigen::Dynamic> representing orientations as Euler/RPY.

Also added tests🤓

@jorgenfj jorgenfj requested a review from Andeshog December 10, 2025 16:57
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.11%. Comparing base (32201be) to head (b4c6911).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   98.03%   98.11%   +0.08%     
==========================================
  Files           5        5              
  Lines         407      425      +18     
  Branches       87       97      +10     
==========================================
+ Hits          399      417      +18     
  Misses          4        4              
  Partials        4        4              
Flag Coverage Δ
unittests 98.11% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/vortex/utils/ros_conversions.hpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +201 to +206
template <typename T>
concept ROSPoseLike =
same_bare_as<T, geometry_msgs::msg::Pose> ||
same_bare_as<T, geometry_msgs::msg::PoseArray> ||
same_bare_as<T, geometry_msgs::msg::PoseStamped> ||
same_bare_as<T, geometry_msgs::msg::PoseWithCovarianceStamped>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just have one function that converts from Pose to Eigen::Matrix<double, 6, 1>? All of the types include Pose, so it will be pretty straightforward to use on them anyway 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I have a test node I'm working on where the pose subscriber callback function is templated so the function call becomes uniform for all pose types:

template <ValidPoseMsg MsgT>
void IPDAPoseFilteringNode::pose_callback(
    const typename MsgT::ConstSharedPtr& msg) {
    Measurements measurements = vortex::utils::ros_conversions::ros_to_eigen6d(*msg);

Where measurements defined:

using Measurements = Eigen::Matrix<double, 6, Eigen::Dynamic>;

Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough👌🏼

@jorgenfj jorgenfj merged commit 69391c1 into main Dec 10, 2025
5 checks passed
@jorgenfj jorgenfj deleted the feat/pose-type branch December 10, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants